package com.example.werewolf.controller;

import com.example.werewolf.service.GameService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api/game")
@RequiredArgsConstructor
public class GameController {
    private final GameService gameService;

    // 建立 SSE 连接
//    @GetMapping(value = "/sse", produces = MediaType.TEXT_EVENT_STREAM_VALUE)
//    @CrossOrigin(origins = "http://localhost:5173")
//    public SseEmitter sse(@RequestParam String userId) {
//        System.out.println("连接开始");
//        return gameService.connect(userId);
//    }
//
//    // 触发下一阶段
//    @PostMapping("/next-stage")
//    public Response<String> nextStage(@RequestParam(required = false) String userId) {
//        gameService.nextStage("user123");
//        return Response.success("已触发下一阶段");
//    }
//
//    // 结束游戏
//    @PostMapping("/end")
//    public Response<String> endGame(@RequestParam String userId) {
//        gameService.endGame(userId);
//        return Response.success("游戏已结束");
//    }
}